﻿using Nomo.UnityCoreModule.MultiLanguages;

namespace Nomo.UnityEditorModule
{
    [UnityEditor.CanEditMultipleObjects]
    [UnityEditor.CustomEditor(typeof(MultiLanguageText))]
    internal sealed class MultiLanguageTextEditor : UnityEditor.UI.GraphicEditor
    {
        private UnityEditor.SerializedProperty _manualApply;
        private UnityEditor.SerializedProperty _text;
        private UnityEditor.SerializedProperty _fontData;

        protected override void OnEnable()
        {
            base.OnEnable();
            _manualApply = serializedObject.FindProperty("manualApply");
            _text        = serializedObject.FindProperty("m_Text");
            _fontData    = serializedObject.FindProperty("m_FontData");
        }

        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            UnityEditor.EditorGUILayout.PropertyField(_manualApply);
            UnityEditor.EditorGUILayout.PropertyField(_text);
            UnityEditor.EditorGUILayout.PropertyField(_fontData);
            AppearanceControlsGUI();
            RaycastControlsGUI();
            serializedObject.ApplyModifiedProperties();
        }
    }
}
